package com.kensaka.todo.dao;

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class TodoTable {

	private static final String DATABASE_CREATE = "create table todo "
			+ "(_id integer primary key autoincrement, "
			+ "category    text not null, " 
			+ "summary     text not null, "
			+ "description text not null);";

	public static void onCreate (SQLiteDatabase db){
		db.execSQL(DATABASE_CREATE);
	}
	
	public static void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)	{
		Log.w(TodoTable.class.getName(), "upgrading database");
		
		db.execSQL("Drop table if exists todo");
		onCreate(db);
	}
}
